/* $Id: VBoxMPMisc.cpp $ */
/** @file
 * VBox WDDM Miniport driver
 */

 /*
  * Copyright (C) 2011-2020 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
  * available from http://www.virtualbox.org. This file is free software;
  * you can redistribute it and/or modify it under the terms of the GNU
  * General Public License (GPL) as published by the Free Software
  * Foundation, in version 2 as it comes in the "COPYING" file of the
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
  */

#ifndef _WDDM_INCLUDE_VBOXMPMISC_H_
#define _WDDM_INCLUDE_VBOXMPMISC_H_

#include "common/VBoxMPDevExt.h"

NTSTATUS vboxWddmRegQueryDisplaySettingsKeyName(PVBOXMP_DEVEXT pDevExt,
        D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId,
        ULONG cbBuf, PWCHAR pBuf, PULONG pcbResult);
NTSTATUS vboxWddmRegOpenDisplaySettingsKey(IN PVBOXMP_DEVEXT pDevExt,
        D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, OUT PHANDLE phKey);
NTSTATUS vboxWddmRegDisplaySettingsQueryRelX(HANDLE hKey, int *pResult);
NTSTATUS vboxWddmRegDisplaySettingsQueryRelY(HANDLE hKey, int *pResult);
NTSTATUS vboxWddmDisplaySettingsQueryPos(IN PVBOXMP_DEVEXT pDevExt,
        D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, POINT *pPos);
void vboxWddmDmSetupDefaultVramLocation(PVBOXMP_DEVEXT pDevExt,
        D3DDDI_VIDEO_PRESENT_SOURCE_ID ModifiedVidPnSourceId, struct VBOXWDDM_SOURCE *paSources);

VOID vboxWddmCounterU32Wait(UINT32 volatile *pu32, UINT32 u32Val);
NTSTATUS VBoxWddmSlInit(PVBOXMP_DEVEXT pDevExt);
NTSTATUS VBoxWddmSlEnableVSyncNotification(PVBOXMP_DEVEXT pDevExt, BOOLEAN fEnable);
void vboxWddmDiInitDefault(DXGK_DISPLAY_INFORMATION *pInfo,
                           PHYSICAL_ADDRESS PhAddr,
                           D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId);
void vboxWddmDiToAllocData(PVBOXMP_DEVEXT pDevExt,
                           const DXGK_DISPLAY_INFORMATION *pInfo,
                           struct VBOXWDDM_ALLOC_DATA *pAllocData);

#endif
